<template>
  <div>
    <el-dialog
      title="提示"
      :visible.sync="deleteVisible"
      width="30%"
      :before-close="handleClose">
      <span>是否确定删除任务</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose">取 消</el-button>
        <el-button type="primary" @click="handleSubmit">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { taskTemplateDelete } from '@/api/table'
export default {
  props: {
    item: {
      type: Object,
      default: () => {}
    },
    deleteVisible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
    }
  },
  methods: {
    handleClose() {
      this.$emit('deleteResult', 'false')
    },
    handleSubmit() {
      taskTemplateDelete({ id: this.item.id }).then(res => {
        if (res.status == 200) {
          this.$emit('deleteResult')
        }
        console.log(res)
      })
    }
  }
}
</script>
